package io.github.talelin.latticy.controller.zty;


import io.github.talelin.core.annotation.LoginRequired;
import io.github.talelin.latticy.common.LocalUser;
import io.github.talelin.latticy.model.BookDO;
import io.github.talelin.latticy.model.UserDO;
import io.github.talelin.latticy.model.ztyDO.ShopStockDO;
import io.github.talelin.latticy.model.ztyDO.WarehouseStockDO;
import io.github.talelin.latticy.pojo.ShopStock;
import io.github.talelin.latticy.service.ShopStockService;
import io.github.talelin.latticy.service.WarehouseStockService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author ZTY
 * @since 2021-04-15
 */
@RestController
@RequestMapping("/warehouseStock")
public class WarehouseStockController {

    @Autowired
    WarehouseStockService warehouseStockService;


    @GetMapping("")
    @LoginRequired
    public List<WarehouseStockDO> getShopStocks() {
        System.out.println("wjjnb");
//        UserDO localUser = LocalUser.getLocalUser();
        List<WarehouseStockDO> warehouseStockDOs = warehouseStockService.selectAll();
        warehouseStockDOs.forEach(System.out::println);
        return warehouseStockDOs;
    }
}

